package view;

import java.awt.BorderLayout;
import java.awt.Color;
import java.util.Observable;
import java.util.Observer;

import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;

import model.Catalogo;
import model.ProxyPezzo;

public class LogPanel extends JPanel implements Observer {

	private static final long serialVersionUID = 1L;

	JTextArea area2 = new JTextArea();
	private Catalogo catalogo;

	public LogPanel(Catalogo catalogo) {
		this.catalogo = catalogo;
		catalogo.addObserver(this);

		// this.logdata = new LogPanelData(event);

		setLayout(new BorderLayout());

		area2.setEditable(false);
		area2.setBackground(Color.WHITE);

		add(area2, BorderLayout.CENTER);
		JScrollPane scrollPane = new JScrollPane(area2);
		add(scrollPane);
	}

	@Override
	public void update(Observable o, Object arg) {

			area2.setText(catalogo.genText());
		
	}
}
